 p = 0:1:50;
 mu = 2.4;
 h = 1/50;

z = 1i * sin(2*pi * p*h) + cos(2*pi * p*h) - 1;
plot(real(z), imag(z)); 
hold on

n = 50;
A = zeros(n);
for i = 1:n-2
    A(i,i) = 3;
    A(i + 1, i) = -4;
    A(i + 2, i) = 1;
end
A(n-1,n-1) = 3;
A(n, n-1) = -4;
A(n,n) = 3;
A(1, n) = -4;
A(1, n - 1) = 1;
A(2, n) = 1;

B = zeros(n);
for i = 1:n-2
    B(i,i) = 1;
    B(i + 1, i) = -2;
    B(i + 2, i) = 1;
end
B(n-1,n-1) = 1;
B(n, n-1) = -2;
B(n,n) = 1;
B(1, n) = -2;
B(1, n - 1) = 1;
B(2, n) = 1;

v_a = eig(A);
v_b = eig(B);
z_p = -mu/2.*v_a + mu^2/2 .* v_b;
sz = 10; 
scatter(real(z_p), imag(z_p),sz,'filled'); 
axis equal;